#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<string.h>
const char T = '=';
const char* s = "...";
const int N = 100;
void process(double current , double totol)
{
  int  p  = (current/totol)*100;
  
  //初始化 下载显示
  char s1[3];
  memset(s1,'\0',3);
  static int pi = 0;
  pi %= 3;
  memcpy(s1,s,pi+1);
  pi++;

  //初始化进度条
  char c[N];
  memset(c,'\0',sizeof(c));
  int i = 0;
  for(; i < (int)current ; i ++)
  {
    c[i] = T;
  }
  
  //打印
  printf("[%-100s][%-2d%%][%-3s]\r",c,p,s1);
  fflush(stdout);
  usleep(100000);
}
